import '/library/src/printers/pretty_printer.dart';

import 'filters/development_filter.dart';
import 'log_filter.dart';
import 'log_output.dart';
import 'log_printer.dart';
import 'logger.dart';
import 'outputs/console_output.dart';

///
/// @ProjectName: flutter_mh
/// @Package:
/// @ClassName: log_config
/// @Description:  log 配置 在logManager.init  时传入自定义parameter
/// @Author: 小麦穗
/// @CreateDate: 2023/5/19 9:42
/// @UpdateUser: 更新者
/// @UpdateDate: 2023/5/19 9:42
/// @UpdateRemark: 更新说明
/// @Version: 1.0


class LogConfig {
  static Level level = Level.verbose;
  late  final LogFilter filter;
  late  final LogPrinter printer;
  late final LogOutput output;


  LogConfig({
    LogFilter? filterParaMeter,
    LogPrinter? printerParaMeter,
    LogOutput? outputParaMeter,
    Level? level,
}) : filter = filterParaMeter ?? DevelopmentFilter(),
        printer = printerParaMeter ?? PrettyPrinter(),
        output = outputParaMeter ?? ConsoleOutput() {
    filter.init();
    filter.level = level ?? LogConfig.level;
    printer.init();
    output.init();
  }
}